package com.YxyBackMange.Init;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.ServletContextAware;


import javax.servlet.ServletContext;

/**
 * Created by Administrator on 2017/3/10.
 */
@Service
@Transactional
public class SystemInit implements InitializingBean, ApplicationContextAware, ServletContextAware {
    private ApplicationContext applicationContext;
    private ServletContext servletContext;

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("\n-------------项目启动成功------------");

    }


    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

    @Override
    public void setServletContext(ServletContext servletContext) {
        this.servletContext = servletContext;
    }
}
